module libeventd.Thread ;
import
	libeventd.Types ;


enum{
	EVTHREAD_WRITE	=0x04,
	EVTHREAD_READ	=0x08,
	EVTHREAD_TRY    =0x10,
	
	EVTHREAD_LOCK_API_VERSION =1,
	EVTHREAD_LOCKTYPE_RECURSIVE =1,
	EVTHREAD_LOCKTYPE_READWRITE =2,
}

extern(C):

struct evthread_lock_callbacks {
	ev_int	lock_api_version;
	ev_uint	supported_locktypes;
	void*	function(ev_uint locktype)	alloc;
	void	function(void *lock, ev_uint locktype)	free;
	ev_int	function(ev_uint mode, void *lock)	lock;
	ev_int	function(ev_uint mode, void *lock)	unlock;
}

int evthread_set_lock_callbacks(evthread_lock_callbacks *);
void evthread_set_id_callback(ev_ulong function() id_fn );
version(Windows){
	int evthread_use_windows_threads();
}else{
	int evthread_use_pthreads();
}
void evthread_enable_lock_debuging();
int evthread_make_base_notifiable(event_base *base);
